@extends('home.inc.common')
@section('title')
        <title>{{$archive->title}}-好文-奇异果聚合</title>
        <meta name="keywords" content="{{$archive->tags()->pluck('name')->implode(',')}}" />
        <meta name="description" content="{{$archive->abstract}}"/>
        <link href="{{asset('home_new/css/libs.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/global.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/page2.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/page.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/page_article.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/qyg2016.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home/js/skin/layer.css')}}" type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="{{asset('home/js/jquery-3.1.0.min.js')}}"></script>
        <script type="text/javascript" src="{{asset('pulgin/layer/layer.js')}}"></script>
@endsection
 @section('content')
     <style>
         .pagination li{
             float:left;
         }
         .active a{
              color: #fff;
              background-color: #2EB872;
         }
     </style>
        <div class="wrap">
            <div id="main">
                @include('home.inc.article_category')
                <div class="media_content">
                    <div class="plus_wrap  plus_wrap_post clear">
                        <div class="post_content clear" style="">
                            <div class="content_left" style="">
                                <div class="post_content">
                                    <div class="content_guide global_guide">
                                        <a href="{{url('/')}}">
                                            首页
                                        </a>
                                        &gt;
                                        <a href="{{url('article')}}">
                                            好文
                                        </a>
                                        &gt;
                                        @if($cate_info)
                                        <a href="{{url('article/cate'.'/'.$cate_info->cate_id)}}">
                                            {{$cate_info->cate_name}}
                                        </a>
                                        &gt;
                                        @endif

                                            {{$archive->title}}

                                    </div>
                                    <div class="content_title">
                                        <h1 style="font-size:22px;">
                                            {{$archive->title}}
                                        </h1>
                                    </div>
                                    <div class="content_info">
                                        @foreach($archive->tags()->get() as $tag)
                                            {{--<dt style="border: solid 1px #{{$tag->background_color or '006633'}};">--}}
                                            <a href="{{$tag->url}}" target="_blank" class="article_tag">{{$tag->name}}</a>
                                            {{--</dt>--}}
                                        @endforeach

                                        @if($archive->isLiked(session('user')))
                                                <a href="#" class="like" data-login="{{$login}}" style="color: #2EB872;">已收藏</a>
                                        @else
                                                <a href="#" class="like" data-login="{{$login}}" style="">收藏</a>
                                        @endif
                                        <span class="info_right">
                                            <s class="global_grey_icons grey_time">
                                            </s>
                                            <em class="global_icons_gap">
                                                {{worldTime(strtotime($archive->updated_at))}}
                                            </em>
                                            <s class="global_grey_icons grey_line">
                                            </s>
                                            <s class="global_grey_icons grey_view">
                                            </s>
                                            <em class="global_icons_gap">
                                                {{$archive->visit_count}}
                                            </em>
                                            <s class="global_grey_icons grey_num">
                                            </s>
                                            <em class="global_icons_gap">
                                                <span href="#SOHUCS" id="changyan_count_unit"></span>
                                                <script type="text/javascript" src="http://assets.changyan.sohu.com/upload/plugins/plugins.count.js">
                                                </script>
                                            </em>
                                        </span>
                                    </div>
                                    <div class="content_inner">
                                        <div class="content_article">
                                            <table width="100%"><tr><td>
                                                        @if(isset($review) && (!$review))
                                                            <h2 style="color:red;">该篇内容尚未通过审核，现属于预览状态！</h2>
                                                        @endif
                                                        {!! $content !!}

                                            </td></tr></table>
                                        </div>
                                        @if(!empty($content->links()->html))
                                        <div class="global_page" style="height:40px;position: relative;">
                                            {{$content->links()}}
                                        </div>
                                        @endif
                                    </div>
                                </div>
                                <a href="http://weibo.com/u/5897732591" target="_blank" rel="nofollow"><img src="{{asset('home_new/images/article_foot_qrcode.jpg')}}" /></a>
                                <div class="post_comment">
                                    @include('inc.comment')
                                </div>
                            </div>
                            <div class="content_right">
                                <div class="side_user clear">
                                    <div class="triangle-bottomright">
                                    </div>
                                    <div class="user_left">
                                        <a href="{{ route('author.index', [$archive->user_id]) }}" target="_blank" class="global_user big"
                                        rel="nofollow">
                                            @if($archive->user->head_img)
                                                <img src="{{$archive->user->head_img}}" alt="" onerror="this.src='{{asset('img/200200.png')}}'" class="userPic_size"/>
                                            @else
                                                <img src="{{asset('img/200200.png')}}" alt="" class="userPic_size"/>
                                            @endif
                                        </a>
                                    </div>
                                    <div class="user_right">
                                        @if($archive->archive_type_id==1)
                                            @if($archive->user->nickname)
                                                <a class="user_name" rel="nofollow" title="{{$archive->user->nickname}}">{{mb_substr($archive->user->nickname,0,8)}}
                                                    @if(mb_strlen($archive->user->nickname)>8)
                                                        ...
                                                    @endif
                                                </a>
                                            @else
                                                <a>{{mb_substr($archive->user->phone, 0, 6)}}...</a>
                                            @endif
                                        @else
                                            <a class="user_name" rel="nofollow" title="{{$archive->detail->author}}">{{mb_substr($archive->detail->author,0,8)}}
                                                @if(mb_strlen($archive->detail->author)>8)
                                                    ...
                                                @endif
                                            </a>
                                        @endif
                                        <a class="user_intro" href="#" target="_blank"
                                        rel="nofollow">
                                        </a>
                                        <span class="user_award clear">
                                        </span>
                                        <div class="user_info clear">
                                            <a href="#" target="_blank" rel="nofollow">
                                                <span>
                                                    发帖
                                                </span>
                                                <span class="global_nums">
                                                    {{$arc_count}}
                                                </span>
                                                <em>
                                                    |
                                                </em>
                                                <span>
                                                    粉丝
                                                </span>
                                                <span class="global_nums">
                                                    {{$follow_count}}
                                                </span>
                                            </a>
                                        </div>
                                    </div>
                                    @if($archive->archive_type_id==1)
                                    <div class="clear">
                                        <a href="{{ route('author.index', [$archive->user_id]) }}" target="_blank" class="group_join group_side_btn">
                                            作者主页
                                        </a>
                                        @if($followed==1)
                                            <a href="#"  class="group_new group_side_btn" data-follow="{{$followed}}">已关注</a>
                                        @elseif($followed==-1)
                                            <a href="#"  class="group_new group_side_btn" data-follow="{{$followed}}">关注作者</a>
                                        @else
                                            <a href="#"  class="group_new group_side_btn" data-follow="{{$followed}}">关注作者</a>
                                        @endif
                                    </div>
                                    @endif
                                </div>

                                <div class="side_group_new">
                                    <h2 class="new_title">
                                        最新文章
                                    </h2>
                                    <ul class="new_inner">
                                        @if(isset($new))
                                        @foreach($new as $v)
                                        <li class="clear">
                                            <a class="inner_title" href="{{route('article.show', [$v->id])}}" title="{{$v->title}}">{{mb_substr($v->title,0,17)}}@if(strlen($v->title)>48)...@endif</a>
                                            <p class="new_intro">
                                                @if($v->tags()->skip(0)->take(1)->first())
                                                <a href="{{$v->tags()->skip(0)->take(1)->first()->url}}" class="s_username left" target="_blank" rel="nofollow">
                                                    {{$v->tags()->skip(0)->take(1)->first()->name}} |
                                                </a>
                                                @endif
                                                    @if($v->tags()->skip(1)->take(1)->first())
                                                <a href="{{$v->tags()->skip(1)->take(1)->first()->url}}" class="s_username left" target="_blank" rel="nofollow">
                                                    &nbsp;{{$v->tags()->skip(1)->take(1)->first()->name}}
                                                </a>
                                                @endif
                                                <span class="right">
                                                <s class="global_grey_icons grey_time"></s>

                                                <em class="global_icons_gap">{{worldTime(strtotime($v->updated_at))}}</em>

                                                </span>
                                            </p>
                                        </li>
                                        @endforeach
                                            @endif
                                    </ul>
                                </div>

                                <!-- 热门文章，调用作者的热门文章 -->
                                <div class="side_group_great side_group_new">
                                    <h2 class="new_title">
                                        热门点击
                                    </h2>
                                    <ul class="new_inner">
                                        @if($hot)
                                        @foreach($hot as $v)
                                        <li class="clear">
                                            <a class="inner_title" href="{{route('article.show', [$v->id])}}" title="{{$v->title}}">{{mb_substr($v->title,0,17)}}@if(strlen($v->title)>48)...@endif</a>
                                            <p><a rel="nofollow" href="{{$v->tags()->skip(0)->take(1)->first()->url}}" class="s_username" target="_blank">{{$v->tags()->skip(0)->take(1)->first()->name}}</a>
                                            <span class="right">
                                                <s class="global_grey_icons grey_view"></s>
                                                <em class="global_icons_gap">{{$v->visit_count}}</em>
                                                <s class="global_grey_icons grey_num"></s>
                                                <em class="global_icons_gap"> <span id = "sourceId::{{$v->id}}" class = "cy_cmt_count" ></span>
                                                    <script id="cy_cmt_num" src="http://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=cyrlo1kOL">
                                                    </script></em>
                                            </span>
                                            </p>
                                        </li>
                                        @endforeach
                                            @endif
                                    </ul>
                                </div>
                                <!-- 热门文章，调用作者的热门文章 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
            $(function(){
                $('.img_link').attr('style','width: 24px;height: 24px;display: inline-block;vertical-align: middle;border-radius: 15px;overflow: hidden;margin-top: 7px;margin-left: 11px;')
            });

        </script>
        @include('inc.archive-scripts')
  @endsection